import 'package:dk_flutter_base/src/ui/page/page_base_home.dart';
import 'package:dk_flutter_base/src/ui/widget/dk_bottom_app_bar.dart';
import 'package:dk_flutter_base/src/ui/widget/dk_bottom_navigation_bar.dart';
import 'package:flutter/material.dart';

class NavigationBottomApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    List<BottomNavigationBarItem> items = List()
      ..add(BottomNavigationBarItem(
        icon: Icon(Icons.directions_bike),
        title: Text("1"),
        activeIcon: Icon(Icons.add),
      ))
      ..add(BottomNavigationBarItem(
        icon: Icon(Icons.directions_bike),
        title: Text("2"),
        activeIcon: Icon(Icons.add),
      ))
      ..add(BottomNavigationBarItem(
        icon: Icon(Icons.directions_bike),
        title: Text("3"),
        activeIcon: Icon(Icons.add),
      ))
      ..add(BottomNavigationBarItem(
        icon: Icon(Icons.directions_bike),
        title: Text("4"),
        activeIcon: Icon(Icons.add),
      ));
    BottomAppBarParam bottomBarParam = BottomAppBarParam.withNavigation(
        BottomNavigationBarOption.withDefault(items,
            floatingActionButton: FloatingActionButton(
              tooltip: 'Increment',
              child: Icon(Icons.add),
            ),
            floatingActionButtonLocation:
                FloatingActionButtonLocation.centerDocked,
            selectedItemColor: Colors.green,
            unselectedItemColor: Colors.blue),
        shape: CircularNotchedRectangle(),
        notchMargin: 4.0);
    BaseHomePageParam pageParam = BaseHomePageParam.withNormalWidgets([
      Center(
        child: Text("home1"),
      ),
      Center(
        child: Text("home2"),
      ),
      Center(
        child: Text("home3"),
      ),
      Center(
        child: Text("home4"),
      ),
    ], bottomBarParam);
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
//      home: MyHomePage(title: 'Flutter Demo Home Page'),
      home: BaseHomePage.createByParam(pageParam),
    );
  }
}
